package tools;

/**
 * Static class to verify system properties.
 * Uses the properties of the JRE and not of the processor.
 * @author Jean-François Augé
 * @see http://www.mkyong.com/java/how-to-detect-os-in-java-systemgetpropertyosname/
 */
public class OSVerificator {

	private static String name_os = System.getProperty("os.name").toLowerCase();
	private static String arch_os = System.getProperty("os.arch").toLowerCase();
	
	/**
	 * Return true if the system is an x86 architecture
	 * @return
	 */
	public static boolean isX86() { return (arch_os.indexOf("x86") >= 0); }
	
	/**
	 * Return true if the system is Windows
	 * @return
	 */	
	public static boolean isWin() { return (name_os.indexOf("win") >= 0); }
	
	/**
	 * Return true if the system is Windows XP
	 * @return
	 */	
	public static boolean isWinXP() { return (name_os.indexOf("windows xp") >= 0); }
	
	
	// tests
	public static void main(String[] args) {
		System.out.println(name_os);
		System.out.println(arch_os);
	}

}
